<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <form name="form1">
        <h2>form1</h2>
        <p>
            <input type="text" name="username">
        </p>
    </form>
    <script>
        // 文本输入
        // document.form1.username.oninput = function (e) {
        //     console.log('oninput', e.target.value, this.value);
        // }
        // 文本改变（之前->之后不一致）
        // document.form1.username.onchange = function (e) {
        //     console.log('onchange', e.target.value, this.value);
        // }
        document.form1.username.oncut = function () {
            console.log('oncut');
        }
        document.form1.username.oncopy = function () {
            console.log('oncopy');
        }
        document.form1.username.onpaste = function () {
            console.log('onpaste');
        }


    </script>
</body>

</html>